import request from "@/utils/request";

// 查询易宝(代盈宝)银行卡代扣商户列表
export function listYeepayWithhold(query) {
  return request({
    url: "/ecs/yeepayWithhold/list",
    method: "get",
    params: query,
  });
}

// 查询易宝(代盈宝)银行卡代扣商户详细
export function getYeepayWithhold(id) {
  return request({
    url: "/ecs/yeepayWithhold/" + id,
    method: "get",
  });
}

// 新增易宝(代盈宝)银行卡代扣商户
export function addYeepayWithhold(data) {
  return request({
    url: "/ecs/yeepayWithhold",
    method: "post",
    data: data,
  });
}

// 修改易宝(代盈宝)银行卡代扣商户
export function updateYeepayWithhold(data) {
  return request({
    url: "/ecs/yeepayWithhold",
    method: "put",
    data: data,
  });
}

export function updateYeepayWithholdFeeRate(data) {
  return request({
    url: "/ecs/yeepayWithhold/editFeeRate",
    method: "put",
    data: data,
  });
}

// 删除易宝(代盈宝)银行卡代扣商户
export function delYeepayWithhold(id) {
  return request({
    url: "/ecs/yeepayWithhold/" + id,
    method: "delete",
  });
}

// 创建
export function createYeepayWithhold(id) {
  return request({
    url: "/ecs/yeepayWithhold/create/" + id,
    method: "post",
  });
}

// 绑卡
export function bindYeepayWithhold(id) {
  return request({
    url: "/ecs/yeepayWithhold/bind/" + id,
    method: "post",
  });
}

// 解绑
export function unbindYeepayWithhold(id) {
  return request({
    url: "/ecs/yeepayWithhold/unbind/" + id,
    method: "post",
  });
}

// 查询
export function queryYeepayWithhold(id) {
  return request({
    url: "/ecs/yeepayWithhold/query/" + id,
    method: "post",
  });
}

// 授权
export function authYeepayWithhold(id, channelType, businessType) {
  return request({
    url: `/ecs/yeepayWithhold/auth/${id}/${channelType}/${businessType}`,
    method: "post",
  });
}
